using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Animoso.Domain;
using Animoso.Domain.Data;

namespace Animoso.Web.Controllers
{
    public class AgendaController : ApplicationController
    {
        private IRepository<Event> _eventRepository;
        private ILabelRepository _labelRepository;

        public AgendaController(IRepository<Event> eventRepository, ILabelRepository labelRepository)
        {
            _eventRepository = eventRepository;
            _labelRepository = labelRepository;
        }

        public ActionResult Index()
        {
            string agendaTitle = _labelRepository.GetTextByLabel("agendaTitle");
            string agendaDescription = _labelRepository.GetTextByLabel("agendaDescription");

            ViewData["agendaTitle"] = agendaTitle;
            ViewData["agendaDescription"] = agendaDescription;

            IEnumerable<Event> events = _eventRepository.GetAll();
            return View(events);
        }
    }
}
